<template>
  <div id="app">
    <img src="./assets/logo.png">
    <button @click="getregid">RegistationID:</button>
    <label >
      <input type="text" v-model="regid"> {{regid}}
    </label>
    <router-view/>
  </div>
</template>

<script>
export default {
  name: 'App',
  data (){
     return {
        regid:''
     }
  },
  methods:{
      getregid (){
        alert(JSON.stringify(window.JPush))
         window.JPush.getRegistrationID(this.onGetRegistrationID);
         alert("huoqu ")
      },
      onGetRegistrationID (data){
         try {
            alert('JPushPlugin:registrationID is= ' +data);
            if(data.length==0){
               var t1= window.steTimout(getRegistationID,1000);
               this.regid=data;
            }
         } catch (exception){
            alert(exception)
            alert(exception)
         }
      }
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
